package com.yly.module.sys.home;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.yly.common.basic.dao.BasicSupportDao;
import com.yly.utils.StrUtil;

@Repository
public class SysHomeDaoImpl extends BasicSupportDao implements ISysHomeDao {

	private static final String URL = "javascript:void(0)";
	
	@SuppressWarnings("rawtypes")
	@Override
	public Map<String, String> getTop(Map param) {
		
		return null;
	}

	@SuppressWarnings("rawtypes")
	@Override
	public List<Map<String, ?>> getLeft(Map param) {
		List list = new ArrayList();
		for (int i = 0; i < 6; i++) {
			Map map = new HashMap();
			map.put("mod_id", "id_" + i);
			map.put("mod_name", "测试模块_" + i);
			map.put("mod_url", "http://www.baidu.com");
			List li = new ArrayList();
			for (int j = 0; j < 40; j++) {
				Map mp = new HashMap();
				mp.put("mod_id", "id_" + i + "_" + j);
				mp.put("mod_name", "测试子模块三_" + i + "_" + j);
				String modUrl = "http://www.baidu.com";
				modUrl = StrUtil.nil(modUrl) ? URL : modUrl;
				mp.put("mod_url", modUrl);
				li.add(mp);
			}
			map.put("mod_list", li);
			list.add(map);
		}
		return list;
	}

	@SuppressWarnings("rawtypes")
	@Override
	public Map<String, ?> getRight(Map param) {
		
		return null;
	}

	@SuppressWarnings("rawtypes")
	@Override
	public List<Map<String, String>> getChannel(Map param) {
		
		List list = new ArrayList();
		for (int i = 0; i < 4; i++) {
			Map map = new HashMap();
			map.put("mod_id", "id_" + i);
			map.put("mod_name", "测试模块_" + i);
			map.put("mod_url", "http://www.baidu.com");
			List li = new ArrayList();
			for (int j = 0; j < 5; j++) {
				Map mp = new HashMap();
				mp.put("mod_id", "id_" + i + "_" + j);
				mp.put("mod_name", "测试子模块三_" + i + "_" + j);
				String modUrl = "http://www.baidu.com";
				modUrl = StrUtil.nil(modUrl) ? URL : modUrl;
				mp.put("mod_url", modUrl);
				li.add(mp);
			}
			map.put("mod_list", li);
			list.add(map);
		}
		
		return list;
	}

	
	
}
